package day05;

import day04.ScoreLevel;

import java.util.Scanner;

public class ForDemo {
    public static void main(String[] args) {
        System.out.println("准备好了吗 开始答题");
        System.out.println("1.确认 2.退出");
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();


        int score =0;
        if(a==1){
            System.out.println("欢迎来到答题时间,一共10道题");
            for (int i = 0; i <10 ; i++) {
                int b =(int)(Math.random()*10+1);
                int c =(int)(Math.random()*10+1);
                int d =b+c;
                System.out.println("请计算"+b+"+"+c+"=");
                int e  = sc.nextInt();
                if (e == d){
                    score +=10;

                }else{
                    System.out.println("可惜 回答错误");

                }
                System.out.println("回答正确,目前得分："+score);
                if (e==-1){
                    System.out.println("退出答题系统");
                    break;
                }

            }


        }
    }
}
